package com.mtzqc.common.init.impl

import android.app.Application
import com.didi.drouter.annotation.Service
import com.kongzue.dialogx.DialogX
import com.kongzue.dialogx.R
import com.kongzue.dialogx.dialogs.WaitDialog
import com.mtzqc.common.init.InitService
import com.mtzqc.common.task.ITask

@Service(function = [InitService::class], priority = 108)
class DialogXRegister : InitService {
    override val depName: String
        get() = "DialogX"
    override val dependsLib: Array<Class<out ITask>>?
        get() = null
    override val depends: Array<String>?
        get() = null
    override val priority: Int
        get() = 108

    override fun executeInit(app: Application, debug: Boolean, dev: Boolean): Boolean {
        DialogX.init(app)
        DialogX.DEBUGMODE = debug
        DialogX.globalTheme = DialogX.THEME.AUTO;
        //设置 InputDialog 自动弹出键盘
        DialogX.autoShowInputKeyboard = true;
        //限制 PopTip 一次只显示一个实例（关闭后可以同时弹出多个 PopTip）
        DialogX.onlyOnePopTip = true
        //设置默认提示框及等待框（WaitDialog、TipDialog）默认是否可以关闭
        DialogX.cancelableTipDialog = true
        return true
    }
}